Source: fivethirtyeight
AKA “Please just don’t make me point-and-click 100 charts”
Source: Hadley Wickham
Source: ggplot2
In the first edition of @FT's World Cup Extra series of stats-y briefings, @muradahmed and I ask: as curtain-raisers go, just how underwhelming is Russia vs Saudi Arabia?https://t.co/0aQXcaD9YV pic.twitter.com/GOXVyVlRW7
— John Burn-Murdoch (@jburnmurdoch) June 13, 2018
Source: Hadley Wickham
| name | year | category | lat | long | wind | pressure |
|---|---|---|---|---|---|---|
| Richard | 2010 | 1 | 17.0 | -87.3 | 80 | 984 |
| Erin | 2001 | 3 | 33.3 | -63.3 | 105 | 969 |
| Barry | 1995 | 0 | 38.7 | -66.0 | 50 | 996 |
| Edouard | 1990 | 0 | 39.6 | -28.1 | 35 | 1006 |
| Olga | 2001 | 0 | 30.3 | -49.5 | 50 | 989 |
| Felix | 1989 | 0 | 33.8 | -43.9 | 35 | 1005 |
| Ernesto | 2006 | 0 | 21.6 | -77.4 | 35 | 1007 |
| Fabian | 1997 | 0 | 29.2 | -57.9 | 35 | 1005 |
| Lili | 1996 | 0 | 42.3 | -33.2 | 60 | 980 |
| Klaus | 1990 | 0 | 16.8 | -60.7 | 55 | 997 |
ggplot(data = )
aes(x = , y = , color = )
X or Y
Color or Fill
Size
Shape
Others: transparency, animations, faceting
Plots are often called their geometric object(s).
Bar
geom_bar()
Line
geom_line()
Point
geom_point()
?
Path of Hurricane Katrina
Before
scale_x_continuous()
After
scale_x_log10()
Before
scale_size_continuous(breaks = c(25, 75, 125))
After
scale_size_continuous(range = c(0.5, 20), breaks = c(25, 75, 125))
coord_polar()
Facet wrap
facet_wrap(~category)
Facet grid
facet_grid(month~status)
Count
Default theme
fivethirtyeight theme
urbnthemes
Source: Policyviz by Jon Schwabish
Animation
By Sarah Strochak
3.2, 4.2, 4.3, 4.7, 5.12
A
B
Once you understand ggplot2, it is really useful for doing 90% of the results with 10% of the effort
(Jennfer Hill)
A+
B+
A+